<?php

namespace app\http\middleware;

class Check
{
    public function handle($request, \Closure $next)
    {

        if(session('?sid') && session('sid') === 'coco')
        {
            $request->userinfo = ['uname'=>"陈帅",'id'=>1];
            return $next($request);
        }
        header('location:'.url('login/index'));
        exit();
    }
}
